<script setup>
import { onMounted } from 'vue'
import { login } from '@/api.js'

const loginData = {
  username: 'admin',
  password: '12345',
  grantType: "password"
};
// 定义一个方法，用于发送请求
const fetchData = async () => {
  const response = await login(loginData);
  console.log(response)
};

// 在组件挂载时调用 fetchData
onMounted(() => {
  fetchData();
});
</script>

<template>

</template>